﻿package com.tudou.home.consts
{
    import flash.geom.*;
    import flash.system.*;

    public class PlayerConsts extends Object
    {
        private static var _SKIN_WIDTH:uint = 596;
        private static const _FIXED_MAIN_STAGE_HEIGHT:Number = 583;
        private static var _STAGE_HEIGHT:uint = 497;
        private static const STAGE_SKIN_X_SCALE:Number = STAGE_WIDTH / SKIN_WIDTH;
        private static var _FIXED_MAIN_HEIGHT:Number = _DEFAULT_MAIN_HEIGHT;
        public static const PRIVACY_WIDTH:uint = 310;
        private static const _DEFAULT_MAIN_HEIGHT:Number = _SKIN_HEIGTH;
        private static const VIDEO_MAX_WIDTH:uint = 720;
        public static const START_MINI_DELAY_TIME:Number = 10;
        private static const _DEFAULT_MAIN_WIDTH:Number = _SKIN_WIDTH;
        public static const AD_PRECACHE_DELAY_TIME:Number = 60;
        private static const _FIXED_MAIN_STAGE_WIDTH:Number = _STAGE_WIDTH;
        public static const AD_TIMEOUT_TIME:Number = 4;
        public static const CONTROL_DEFAULT_HEIGTH:uint = 43;
        public static const SAMPLE_USERS:Array = ["6032716", "2825588", "1195183", "50155535"];
        private static const STAGE_SKIN_Y_SCALE:Number = STAGE_HEIGHT / SKIN_HEIGTH;
        private static var _expandStage:Boolean = false;
        private static var _STAGE_WIDTH:uint = 1000;
        private static var _FIXED_MAIN_WIDTH:Number = _DEFAULT_MAIN_WIDTH;
        public static const PRIVACY_HEIGTH:uint = 141;
        public static const BACKGROUND_FRAME_THICKNESS:uint = 2;
        private static var _SKIN_HEIGTH:uint = 489;
        public static const NOAD_USERS:Array = ["69954298", "30137071"];
        private static var FULL_STAGE_WIDTH:uint = Capabilities.screenResolutionX;
        private static var FULL_STAGE_HEIGHT:uint = Capabilities.screenResolutionY;
        public static var HAS_HARD_WORK:Boolean = true;
        private static const VIDEO_MAX_HEIGHT:uint = 576;

        public function PlayerConsts()
        {
            return;
        }// end function

        public static function get FIXED_MAIN_HEIGHT() : uint
        {
            return _FIXED_MAIN_HEIGHT - CONTROL_DEFAULT_HEIGTH;
        }// end function

        public static function get STAGE_WIDTH() : uint
        {
            return _STAGE_WIDTH;
        }// end function

        public static function get SKIN_HEIGTH() : uint
        {
            return _SKIN_HEIGTH;
        }// end function

        public static function set expandStage(param1:Boolean) : void
        {
            _expandStage = param1;
            if (param1)
            {
                _SKIN_WIDTH = STAGE_WIDTH;
                _SKIN_HEIGTH = STAGE_HEIGHT;
                _FIXED_MAIN_WIDTH = _FIXED_MAIN_STAGE_WIDTH - BACKGROUND_FRAME_THICKNESS * 2;
                _FIXED_MAIN_HEIGHT = _FIXED_MAIN_STAGE_HEIGHT - BACKGROUND_FRAME_THICKNESS;
            }
            else
            {
                _SKIN_WIDTH = STAGE_WIDTH / STAGE_SKIN_X_SCALE;
                _SKIN_HEIGTH = STAGE_HEIGHT / STAGE_SKIN_Y_SCALE;
                _FIXED_MAIN_WIDTH = _DEFAULT_MAIN_WIDTH - BACKGROUND_FRAME_THICKNESS * 2;
                _FIXED_MAIN_HEIGHT = _DEFAULT_MAIN_HEIGHT - BACKGROUND_FRAME_THICKNESS;
            }
            return;
        }// end function

        public static function get SKIN_LEFT() : int
        {
            return (STAGE_WIDTH - SKIN_WIDTH) / 2;
        }// end function

        public static function get expandStage() : Boolean
        {
            return _expandStage;
        }// end function

        public static function get NORMALSCREEN_RECT() : Rectangle
        {
            return new Rectangle(0, 0, STAGE_WIDTH, STAGE_HEIGHT);
        }// end function

        public static function get CONTORL_DEFAULT_WIDTH() : uint
        {
            return SKIN_WIDTH;
        }// end function

        public static function get STAGE_HEIGHT() : uint
        {
            return _STAGE_HEIGHT;
        }// end function

        public static function get DEFAULT_VIDEO_WIDTH() : uint
        {
            var _loc_1:* = MAIN_WIDTH - BACKGROUND_FRAME_THICKNESS * 2;
            if (_loc_1 <= 0)
            {
                _loc_1 = MAIN_WIDTH;
            }
            if (_loc_1 > 2400)
            {
                _loc_1 = 2400;
            }
            return _loc_1;
        }// end function

        public static function get MAIN_WIDTH() : uint
        {
            return SKIN_WIDTH;
        }// end function

        public static function setNormalStageWidthHeight(param1:int, param2:int) : void
        {
            if (param1 > 0 && param2 > 0)
            {
                _STAGE_WIDTH = param1;
                _STAGE_HEIGHT = param2;
                expandStage = _expandStage;
            }
            return;
        }// end function

        private static function getRECT() : Rectangle
        {
            var _loc_2:Number = NaN;
            var _loc_3:Number = NaN;
            var _loc_1:* = new Rectangle();
            _loc_1.x = 0;
            _loc_1.y = 0;
            if (HAS_HARD_WORK)
            {
                _loc_2 = FULL_STAGE_WIDTH / FULL_STAGE_HEIGHT;
                _loc_3 = VIDEO_MAX_WIDTH / VIDEO_MAX_HEIGHT;
                if (_loc_2 > _loc_3)
                {
                    _loc_1.height = VIDEO_MAX_HEIGHT;
                    _loc_1.width = VIDEO_MAX_HEIGHT * _loc_2;
                }
                else
                {
                    _loc_1.width = VIDEO_MAX_WIDTH;
                    _loc_1.height = VIDEO_MAX_WIDTH / _loc_2;
                }
            }
            else
            {
                _loc_1.width = FULL_STAGE_WIDTH;
                _loc_1.height = FULL_STAGE_HEIGHT;
            }
            return _loc_1;
        }// end function

        public static function get VIDEO_TOP() : int
        {
            return SKIN_TOP + BACKGROUND_FRAME_THICKNESS;
        }// end function

        public static function get SKIN_WIDTH() : uint
        {
            return _SKIN_WIDTH;
        }// end function

        public static function setFullStageWidthHeight(param1:uint, param2:uint) : void
        {
            FULL_STAGE_WIDTH = param1;
            FULL_STAGE_HEIGHT = param2;
            return;
        }// end function

        public static function get FULLSCREEN_RECT() : Rectangle
        {
            return getRECT();
        }// end function

        public static function get DEFAULT_VIDEO_HEIGHT() : uint
        {
            var _loc_1:* = MAIN_HEIGHT - BACKGROUND_FRAME_THICKNESS;
            if (_loc_1 <= 0)
            {
                _loc_1 = MAIN_HEIGHT;
            }
            if (_loc_1 > 2400)
            {
                _loc_1 = 2400;
            }
            return _loc_1;
        }// end function

        public static function get VIDEO_LEFT() : int
        {
            return SKIN_LEFT + BACKGROUND_FRAME_THICKNESS;
        }// end function

        public static function get MAIN_HEIGHT() : uint
        {
            return SKIN_HEIGTH - CONTROL_DEFAULT_HEIGTH;
        }// end function

        public static function get FIXED_MAIN_WIDTH() : uint
        {
            return _FIXED_MAIN_WIDTH;
        }// end function

        public static function get SKIN_TOP() : int
        {
            return STAGE_HEIGHT - SKIN_HEIGTH;
        }// end function

    }
}
